package com.cgw.web.rent.action;

import java.util.List;

import com.cgw.common.base.BaseAction;
import com.cgw.dmplt.common.PageBean;
import com.cgw.dmplt.rent.dao.RentFlowDao;
import com.cgw.dmplt.rent.domain.RentFlow;

public class RentFlowAction extends BaseAction {

	private RentFlow rentFlow;
	private PageBean<RentFlow> page;
	
	public PageBean<RentFlow> getPage() {
		return page;
	}

	public void setPage(PageBean<RentFlow> page) {
		this.page = page;
	}

	public String doList(){
		
		try {
			if (rentFlow == null)
				rentFlow = new RentFlow();
			RentFlowDao rentDao = (RentFlowDao) getBean("rentFlowDao");
			List<RentFlow> rentFlowList = rentDao.listRentFlow(rentFlow);
			getHttpServletRequest().setAttribute("rentFlowList", rentFlowList);
			Integer count = rentDao.listRentFlowCount(rentFlow);
			page = new PageBean(rentFlowList, count, rentFlow.getCurentPage());
		} catch (Exception e) {
			log.error("查询出租流水列表出错！");
		}
		return SUCCESS;
	}

	public RentFlow getRentFlow() {
		return rentFlow;
	}

	public void setRentFlow(RentFlow rentFlow) {
		this.rentFlow = rentFlow;
	}
}
